///////箭头函数//////////////////////////////////////
var circleAreaES5 = function circleArea(r){
    var PI = 3.14;
    var area = PI * r * r;
    return area;
};
console.log(circleAreaES5(2));

//简化上面代码
const circleArea = r =>{
    const PI = 3.14;
    const area = PI * r * r;
    return area;
};
console.log(circleArea);
///////////////////////////////////////////////////


/////解构赋值////////////////////
///1.数组的解构赋值
let numbers = [10,20,30];
let [firstNumber,secondNumber,thirdNumber] = numbers;
console.log(firstNumber); // 10
console.log(secondNumber); // 20
console.log(thirdNumber); // 30

///2.对象的解构赋值
let person = {
    name:'Alice',
    age:30,
    city: 'New York'
};
let {name,age,city} = preson;
console.log(name); // 'Alice'
console.log(age); // 30
console.log(city); // 'New York
///////////////////////////////////////////////////